package com.fs.sys.web;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.fs.sys.bean.dto.AppUseLogDTO;
import com.fs.sys.bean.query.AppUseLogQuery;
import com.fs.sys.entityservice.AppUseLogEntityService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 应用使用日志控制器
 *
 * @author Coder Generator 2025-10-24 08:58:06
 **/
@RestController
@RequestMapping("/base/app-use-log")
@Slf4j
@Tag(name = "应用使用日志控制器")
public class AppUseLogController {
    @Autowired
    private AppUseLogEntityService service;

    @GetMapping("detail/{id}")
    @Operation(summary = "根据id查找记录")
    public AppUseLogDTO findById(@PathVariable("id") String id) {
        return service.findById(id).orElse(null);
    }

    @PostMapping("page-query")
    @Operation(summary = "查询-分页")
    public IPage<AppUseLogDTO> pageQuery(@RequestBody AppUseLogQuery query) {
        return service.pageQuery(query);
    }

    @PostMapping("query")
    @Operation(summary = "查询-不分页")
    public List<AppUseLogDTO> query(@RequestBody AppUseLogQuery query) {
        return service.query(query);
    }
}